<?php
  require_once('../db.php');
  $query = "SELECT * FROM `users`";
  $result = mysql_query($query) or die(mysql_error());
  $totalUser = mysql_num_rows($result);
?>
<p>
  <em>Total Records </em>:<strong><?=$totalUser?></strong>
</p>

<table  border="1" cellpadding="0" cellspacing="0" width="80%" align="center">
  <thead>
    <tr>
      <th colspan="6">:: ALL USERS ::</th>
    </tr>
    <tr>
      <th align="left">#</th>
      <th align="left">User Name</th>
      <th align="left">Email</th>
      <th align="left">Added date</th>
      <th align="left">Status</th>
      <th align="left">Action</th>
    </tr>
  </thead>
  <tbody>
<?php
  while($ans = mysql_fetch_assoc($result))
  {
?>
    <tr>
      <td ><?=$ans['id']?></td>
      <td ><?=$ans['uname']?></td>
      <td >

<a href="mailto:<?=$ans['email']?>"><?=$ans['email']?></a>

      </td>
      <td ><?=date('d-M-Y',strtotime($ans['added_date']))?></td>
      <td ><?=getStatus($ans['status'])?></td>
      <td align="right">Edit / Delete</td>
    </tr>
<?php
  }
?>
  </tbody>
</table>
